using UnityEngine;
using System.Collections;

//[ExecuteInEditMode]
public class BezierChainTester : MonoBehaviour
{
	public	BezierStepNavigator		m_bsnFirstStepToTest;
	public	Transform				m_tObjToDuplicateAndMove;
	//public BezierChainNavigator[]	m_bcnListOfNavigators;
	public BezierChainNavigator		m_bcnNavigatorToDuplicate;
	
	public void Awake()
	{
		if(!Application.isPlaying){
			BezierStepNavigator			bsnCurStep		= m_bsnFirstStepToTest;
			
			BezierChainNavigator		_bcnNavigatorToDuplicate;
			int i = 0;
			do
			{
				_bcnNavigatorToDuplicate					=	(BezierChainNavigator) GameObject.Instantiate(m_bcnNavigatorToDuplicate);
				_bcnNavigatorToDuplicate.m_fPercentageCur	=	(float) i;
				_bcnNavigatorToDuplicate.m_tObjectToMove	=	(Transform) GameObject.Instantiate(m_tObjToDuplicateAndMove);
				bsnCurStep	=	bsnCurStep.m_bsnDestination;
				++i;
			}
			while(!bsnCurStep.m_bsnDestination.m_bIsLast);
			
			// Create the last one
			_bcnNavigatorToDuplicate					=	(BezierChainNavigator) GameObject.Instantiate(m_bcnNavigatorToDuplicate);
			_bcnNavigatorToDuplicate.m_fPercentageCur	=	(float) i;
			_bcnNavigatorToDuplicate.m_tObjectToMove	=	(Transform) GameObject.Instantiate(m_tObjToDuplicateAndMove);
		}
	}
}

